package com.cysyz.mylib.web.archetype.ssh.action;

/**
 *
 */
public abstract class PageAction extends BaseAction{
    private int page;
    private int pageSize;


    public int getPage() {

        return page;
    }

    public void setPage(int page) {
        if (page <= 0) {
            page = 1;
        }
        this.page = page;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        if (pageSize <= 0 ) {
            pageSize = 5;
        } else if (pageSize > getMaxPageSize()) {
            pageSize = getMaxPageSize();
        }
        this.pageSize = pageSize;
    }

    protected int getMaxPageSize() {
        return 100;
    }
}
